<%
layout("/include/_container.html", {title:"接口测试", parent:"常用工具"}){
%>
<div class="card card-custom card-border">
    <div class="card-heading">
        <h3 class="card-title text-custom m-0">${testInterface.name!'服务器'}接口测试</h3>
    </div>
    <div class="card-body">
        <form method="get" class="form-horizontal">

            <div class="form-group row">
                <label class="col-sm-2 control-label">接口类型</label>

                <div class="col-sm-10">
                    <#radiobuttons path="type" value="${testInterface.type!}" items="${fn.getDictList('interface_type')}" itemLabel="label" itemValue="value" class="form-control required"/>
                </div>
            </div>
            <div class="hr-line-dashed"></div>

            <div class="form-group row">
                <label class="col-sm-2 control-label">请求url</label>
                <div class="col-sm-8">
                    <input type="text" id="serverUrl" title="输入请求地址" value="${testInterface.url!}"
                           class="form-control">
                    <span class="text-muted">如果URL包括JSESSIONID字段，请先调用登录接口，把生成的JSESSIONID参数替换此处的值，否则会提示没有登录。</span>
                </div>
                <div class="col-sm-2">
                    <a class="btn btn-custom waves-effect waves-light" onclick="sendSever();">请求</a>
                    <a class="btn btn-custom waves-effect waves-light" onclick="gReload();">重置</a>
                </div>


            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group row">
                <label class="col-sm-2 control-label">post body</label>
                <div class="col-sm-8">
                    <input type="text" id="requestBody" title="输入请求地址" value="${testInterface.body!}"
                           class="form-control">
                    <span class="text-muted">格式:  name1=value1&name2=value2, 如果是get请求请留空。</span>
                </div>
                <div class="col-sm-2">

                </div>


            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group row">
                <label class="col-sm-2 control-label">返回结果</label>

                <div class="col-sm-8">
                    <textarea id="json-field" title="返回结果" class="form-control span12"></textarea>
                </div>
                <div class="col-sm-2">
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group row">
                <label class="col-sm-2 control-label">服务器响应：</label>
                <div class="col-sm-10">
                    <font color="red" id="stime">-</font>&nbsp;毫秒
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="form-group row">
                <label class="col-sm-2 control-label">客户端请求：</label>
                <div class="col-sm-10">
                    <font color="red" id="ctime">-</font>&nbsp;毫秒
                </div>
            </div>
            <div class="hr-line-dashed"></div>
        </form>
    </div>
</div>
<% include("interfaceTest.js"){} %>
<% } %>